//
//  MTSearchUserModel.swift
//  MT
//
//  Created by ooops on 2020/5/17.
//  Copyright © 2020 张强. All rights reserved.
//

import Foundation
import ObjectMapper
import MTCategory

class MTSearchUserModel: Mappable {
    
    /// 请求是否成功的code
    var code: Int?
    /// 请求返回的Message
    var message: String?
    /// 分页对象
    var page: PageModel?
    /// 时间戳
    var timestamp: TimeInterval?
    
    var result: [MTSearchUserInfoModel]?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        code    <- map["code"]
        message <- map["message"]
        page <- map["page"]
        timestamp <- map["timestamp"]
        result  <- map["result"]
    }
}

class MTSearchUserInfoModel: Mappable {
    
    /// 年龄
    var age: Int?
    /// 用户所属地区
    var area: String?
    /// 收到的礼物数
    var giftPrice: Int?
    /// 用户头像
    var headerUrl: String?
    /// 用户id
    var id: Int?
    /// 用户动态数组?
    var imgs: [MTSearchUserImagesModel]?
    /// 是否是好友关系
    var isFriend: Bool?
    /// 用户昵称
    var nickname: String?
    /// 用户名
    var userName: String?
    /// 用户个性签名
    var signature: String?
    /// 用户性别
    var sex: Int?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        age    <- map["age"]
        area <- map["area"]
        giftPrice <- map["giftPrice"]
        headerUrl <- map["headerUrl"]
        id <- map["id"]
        imgs    <- map["imgs"]
        isFriend <- map["isFriend"]
        nickname <- map["nickname"]
        userName <- map["userName"]
        signature <- map["signature"]
        sex <- map["sex"]
    }
}


class MTSearchUserImagesModel: Mappable {
    
    /// 年龄
    var href: Int?
    /// 用户所属地区
    var objType: Int?
    /// 收到的礼物数
    var ratio: Int?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        href    <- map["href"]
        objType <- map["objType"]
        ratio <- map["ratio"]
    }
}
